<html>
<head><meta charset="utf-8"><title>TransmuteInto? · project-safe-transmute · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/index.html">project-safe-transmute</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html">TransmuteInto?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217718327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217718327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nick12 <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217718327">(Nov 24 2020 at 06:24)</a>:</h4>
<p>I haven't really been following safe transmute discussion, but it seems the latest proposal revolves around TransmuteFrom&lt;Dst&gt;</p>
<p>Would it make sense to also have a TransmuteInto? (With similar blanket impls to From/Into)</p>



<a name="217718526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217718526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217718526">(Nov 24 2020 at 06:28)</a>:</h4>
<p>My understanding is that the RFC is mostly aimed that the parts that have to be implemented by compiler magic, relying on external crates to supply derived constructions. Most likely we will want some of that stuff in std sooner rather than later, but it sounds like a separate RFC</p>



<a name="217720425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217720425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217720425">(Nov 24 2020 at 07:11)</a>:</h4>
<p>I think it would be especially nice if they're <code>#[marker]</code> traits -- which might make sense anyway, since we don't want any methods they have getting overridden -- so overlapping impls would be allowed which could plausibly allow more things that would otherwise be blocked by the blanket impl.</p>



<a name="217828550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217828550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217828550">(Nov 24 2020 at 23:40)</a>:</h4>
<p><span class="user-mention" data-user-id="219940">@Nick12</span>, <code>TransmuteInto</code> was part of the RFC for a long time, but, as <span class="user-mention" data-user-id="271719">@Mario Carneiro</span> points out, it's not intrinsic to the proposal and can really simply be tacked on later. <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="217828730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217828730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217828730">(Nov 24 2020 at 23:43)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> I'm a little cautious about making these traits <code>#[marker]</code> <em>initially</em>. We can always add a <code>#[marker]</code> annotation later, but we cannot remove one that's already there without breaking end-user impls. Since the consequences of allowing overriding impls are subtle, they're maybe better addressed in a small follow-up to the initial RFC?</p>



<a name="217829103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217829103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217829103">(Nov 24 2020 at 23:48)</a>:</h4>
<p>Yeah, no problem with leaving it as potential future use.  Just means being aware of it and designing an interface that means making them marker later wouldn't be a breaking change.</p>



<a name="217829121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/TransmuteInto%3F/near/217829121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/TransmuteInto.3F.html#217829121">(Nov 24 2020 at 23:48)</a>:</h4>
<p>Also always a good thing to not block a project on an unstable feature if one can avoid it <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>